package com.baizhi.object;

/**
 * 对象的复制
 */
public class ObjectDemo3 {
    public static void main(String[] args) throws CloneNotSupportedException {
        String[] love = {"书法","爬山","看电影"};
        Teacher t1 = new Teacher(1,"李老师",38,love);



        Teacher t2 = (Teacher)t1.clone();


        String[] love1 = t1.getLove();
        love1[0] = "潜水";

        System.out.println(t1);
        System.out.println(t2);
    }
}
